package com.house.controller;

import com.house.pojo.FangHouse;
import com.house.service.FangHouseService;
import com.house.utils.R;
import com.house.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 小贾
 * @version 1.0
 * @description: TODO
 * @date 2025/9/15 15:32
 */
@RestController
@RequestMapping("/house/index")
public class HouseController {
    @Autowired
    FangHouseService fangHouseService;

    /**
     * @description 楼盘列表
     * @author 小贾
     * @date 2025/9/15 15:42
     * @version 1.0
     */
    @PostMapping("/houseList")
    public R houseList(@RequestBody PageInfoVo pageInfoVo){
        return fangHouseService.houseList(pageInfoVo);
    }

    /**
     * @description 写字楼列表
     * @author 小贾
     * @date 2025/9/15 15:42
     * @version 1.0
     */
    @PostMapping("/officeRentalList")
    public R officeRentalList(@RequestBody PageInfoVo pageInfoVo){
        return fangHouseService.officeRentalList(pageInfoVo);
    }

    /**
     * @description 出租房列表
     * @author 小贾
     * @date 2025/9/15 15:42
     * @version 1.0
     */
    @PostMapping("/rentalList")
    public R rentalList(@RequestBody PageInfoVo pageInfoVo){
        return fangHouseService.rentalList(pageInfoVo);
    }

    /**
     * @description 二手房列表
     * @author 小贾
     * @date 2025/9/15 15:42
     * @version 1.0
     */
    @PostMapping("/secondHouseList")
    public R secondHouseList(@RequestBody PageInfoVo pageInfoVo){
        return fangHouseService.secondHouseList(pageInfoVo);
    }

    /**
     * @description 楼盘详情
     * @author 小贾
     * @date 2025/9/15 19:51
     * @version 1.0
     */
    @PostMapping("/houseDetail")
    public R houseDetail(Integer id){
        return fangHouseService.houseDetail(id);
    }
    /**
     * @description 写字楼详情
     * @author 小贾
     * @date 2025/9/15 19:51
     * @version 1.0
     */
    @PostMapping("/officeDetail")
    public R officeDetail(Integer id){
        return fangHouseService.officeDetail(id);
    }

    /**
     * @description 出租房详情
     * @author 小贾
     * @date 2025/9/15 19:51
     * @version 1.0
     */
    @PostMapping("/rentalDetail")
    public R rentalDetail(Integer id){
        return fangHouseService.rentalDetail(id);
    }

    /**
     * @description 二手房详情
     * @author 小贾
     * @date 2025/9/15 19:51
     * @version 1.0
     */
    @PostMapping("/rentalSecondDetail")
    public R rentalSecondDetail(Integer id){
        return fangHouseService.rentalSecondDetail(id);
    }

}
